package dljs.classes;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;

/**
 *
 * @author vova
 */
public class BackgroundRenderer {
    public void renderBackground(int nWidth, int nHeight, Graphics g) {
        Graphics2D g2 = (Graphics2D)g;
        
        g.setColor(Color.DARK_GRAY);
        g2.fillRect(0, 0, nWidth, nHeight);
        
        g.setColor(Color.MAGENTA);
        for(int i=0;i<8;i++){
            
            g2.drawRoundRect(GamePanel.getPanelX(3, i), GamePanel.getPanelY(3), CardRenderer.CARD_WIDTH-1, CardRenderer.CARD_HEIGHT-1, 20, 20);
                g2.drawRoundRect(GamePanel.getPanelX(3, i)+1, GamePanel.getPanelY(3)+1, CardRenderer.CARD_WIDTH-3, CardRenderer.CARD_HEIGHT-3, 20, 20);
            if (i<4){
                g2.drawRoundRect(GamePanel.getPanelX(1, i), GamePanel.getPanelY(1), CardRenderer.CARD_WIDTH-1, CardRenderer.CARD_HEIGHT-1, 20, 20);
                g2.drawRoundRect(GamePanel.getPanelX(1, i)+1, GamePanel.getPanelY(1)+1, CardRenderer.CARD_WIDTH-3, CardRenderer.CARD_HEIGHT-3, 20, 20);
            }
            else {
                g2.drawRoundRect(GamePanel.getPanelX(2, i-4), GamePanel.getPanelY(2), CardRenderer.CARD_WIDTH-1, CardRenderer.CARD_HEIGHT-1, 20, 20);
                g2.drawRoundRect(GamePanel.getPanelX(2, i-4)+1, GamePanel.getPanelY(2)+1, CardRenderer.CARD_WIDTH-3, CardRenderer.CARD_HEIGHT-3, 20, 20);
            }
        }        
    }
}
